package mlz.twofordemo;

//循环嵌套
public class TwoForDemo {
    public static void main(String[] args) {


        //循环嵌套的执行流程: 外部循环每循环一次,内部循环全部都会执行完一轮
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 5; j++) {
                System.out.println("你好世界");
            }
        }

        /*
            i = 0, 进入循环
            j = 0, 进入循环
            for (int j = 0; j < 5; j++) {
                System.out.println("你好世界");
            }

            i = 0 ,j = 1
            for (int j = 1; j < 5; j++) {
                System.out.println("你好世界");
            }

            i = 0, j = 2
            for (int j = 1; j < 5; j++) {
                System.out.println("你好世界");
            }

            i = 0 , j = 3....
            i = 0 , j = 4....
            i = 0 , j = 5....

            内部循环结束, 接着外部循环继续

            i = 1 ,j = 0....
            i = 1, j = 1....
            重复以上操作

         */


    }
}
